<html xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui" >  

    <!--    <h:body>-->
    <ui:composition template="layout.xhtml">
        <ui:define name="corpo">
            <h:form id="index_form" acceptcharset="utf-8"> 
                <div id="breadcrumb">
                    <p:commandLink  actionListener="#{managerIndex.redirect('index.xhtml')}" value="Inicio" update="@form" immediate="true"/> >
                    <p:commandLink  actionListener="#{managerIndex.redirect('config.xhtml')}" value="Configurações" update="@form" immediate="true"/> >
                    <p:commandLink  value="Emolumento" update="@form" immediate="true"/>
                </div>
                <p:panel header="Principal - Emolumento">
                    <h:panelGrid style="float: right;" columns="4">
                        <p:graphicImage url="/media/img/new.png" title="Cadastrar Emolumento" /> <p:commandLink   value="Cadastrar" title="Cadastrar Emolumento" actionListener="#{managerEmolumento.redirect('criarEmolumento.xhtml')}" update="@form"/>
                        <p:graphicImage url="/media/img/search.png" title="Pesquisar Emolumento"/><p:commandLink value="Pesquisar" title="Pesquisar Emolumento" actionListener="#{managerEmolumento.redirect('buscarEmolumento.xhtml')}" update="@form"/>
                    </h:panelGrid>
                    <br/>
                    <br/>
                    <p:dataTable id="emolTable" var="emo" value="#{managerVisualizarEmolumento.todos()}" 
                                 paginator="true" rows="5"
                                 paginatorPosition="bottom"
                                 paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}"  
                                 rowsPerPageTemplate="5,10,15">    

                        <f:facet name="header">  
                           Últimos Emolumentos 
                        </f:facet>
                            
                        <p:column  style="width:600px;">  
                            <f:facet name="header" >   
                                Descrição
                            </f:facet>  
                            <h:outputText value="#{emo.descricao}"   />  
                        </p:column>
                        
                        <p:column  style="width:300px;">  
                            <f:facet name="header" >   
                                Data Vigor
                            </f:facet>  
                            <h:outputText value="#{emo.datVigor}" >
                                <f:convertDateTime pattern="dd/MM/yyyy"/>
                            </h:outputText>  
                        </p:column>
                        <p:column  style="width:100px;">  
                            <f:facet name="header" >   
                                Valor do Selo
                            </f:facet>  
                            <h:outputText value="#{emo.valorSelo}" style="float: right;" >
                                        <f:convertNumber type="currency" />
                                    </h:outputText>    
                        </p:column>
                        
                        
                        <p:column style="width:90px;">  
                            <f:facet name="header">  
                                <h:outputText value="Opções" />   
                            </f:facet>
                            <p:commandButton  icon="editar" actionListener="#{managerEditarEmolumento.redirect('editarEmolumento.xhtml', emo)}" update="@form"/> 
                            <p:commandButton  icon="view" actionListener="#{managerVisualizarEmolumento.redirect('visualizarEmolumento.xhtml', emo)}" update="@form"/> 

                        </p:column>
                        
                    </p:dataTable> 

                </p:panel>
            </h:form>
        </ui:define>
    </ui:composition>
</html>
